<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE HTML>
<html>
<head>
  <title>后台管理系统</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <link href="/resources/css/dpl-min.css" rel="stylesheet" type="text/css" />
  <link href="/resources/css/bui-min.css" rel="stylesheet" type="text/css" />
  <link href="/resources/css/page-min.css" rel="stylesheet" type="text/css" />
</head>
<body>

<div class="container">
  <form id="J_Form" class="form-horizontal" action="/partnerApply/save">
    <h3>区域合伙人申请信息</h3>
   <input type="hidden" name="id" id="id" value="${data.id}"/>
    <div class="row">
      <div class="control-group span12">
        <label class="control-label">申请账号：</label>
        <div style="display:inline;height:40px;margin-left: 10px;">
          ${data.userNickName}
        </div>
      </div>
    </div>

    <div class="row">
      <div class="control-group span12">
        <label class="control-label">申请时间：</label>
        <div style="display:inline;height:40px;margin-left: 10px;">
          ${data.dateStr}
        </div>
      </div>
    </div>

      <div class="row">
          <div class="control-group span12">
              <label class="control-label">当前状态：</label>
              <div style="display:inline;height:40px;margin-left: 10px;">
                 <c:if test="${data.status eq '0'}">待审核</c:if>
                 <c:if test="${data.status eq '1'}">审核通过</c:if>
                 <c:if test="${data.status eq '2'}">审核拒绝</c:if>
              </div>
          </div>
      </div>

      <div class="row">
          <div class="control-group span12">
              <label class="control-label">申请代理级别：</label>
              <div style="display:inline;height:40px;margin-left: 10px;">
                  <c:choose>
                      <c:when test="${data.userLevel eq '0'}">省级</c:when>
                      <c:when test="${data.userLevel eq '1'}">副省级</c:when>
                      <c:when test="${data.userLevel eq '2'}">地市</c:when>
                      <c:when test="${data.userLevel eq '3'}">区县</c:when>
                      <c:otherwise>未知类型</c:otherwise>
                  </c:choose>
              </div>
          </div>
      </div>

      <div class="row">
          <div class="control-group span12">
              <label class="control-label">申请代理地市：</label>
              <div style="display:inline;height:40px;margin-left: 10px;">
                  <c:choose>
                      <c:when test="${data.userLevel eq '0'}">${data.provinceName}</c:when>
                      <c:when test="${data.userLevel eq '1'}">${data.provinceName}/${data.cityName}</c:when>
                      <c:when test="${data.userLevel eq '2'}">${data.provinceName}/${data.cityName}</c:when>
                      <c:when test="${data.userLevel eq '3'}">${data.provinceName}/${data.cityName}/${data.areaName}</c:when>
                          <c:otherwise>未知类型</c:otherwise>
                  </c:choose>
              </div>
          </div>
      </div>

      <div class="row">
          <div class="control-group span12">
              <label class="control-label">申请备注信息：</label>
              <div style="display:inline;height:40px;margin-left: 10px;">
                  ${data.remark}
              </div>
          </div>
     </div>

    <c:if test="${data.status ne '0'}">
        <div class="row">
            <div class="control-group span12">
                <label class="control-label">审核时间：</label>
                <div style="display:inline;height:40px;margin-left: 10px;">
                        ${data.applyDateStr}
                </div>
            </div>
        </div>
        <div class="row">
            <div class="control-group span12">
                <label class="control-label">审核意见：</label>
                <div style="display:inline;height:40px;margin-left: 10px;">
                        ${data.bz}
                </div>
            </div>
        </div>
    </c:if>
      <h3>申请人信息</h3>
      <div class="row">
          <div class="control-group span12">
              <label class="control-label">申请人：</label>
              <div style="display:inline;height:40px;margin-left: 10px;">
                  ${address.userName}
              </div>
          </div>
      </div>
      <div class="row">
          <div class="control-group span12">
              <label class="control-label">申请人身份证号：</label>
              <div style="display:inline;height:40px;margin-left: 10px;">
                  ${user.idCard}
              </div>
          </div>
      </div>
      <div class="row">
          <div class="control-group span12">
              <label class="control-label">申请人联系电话：</label>
              <div style="display:inline;height:40px;margin-left: 10px;">
                  ${address.telephone}
              </div>
          </div>
      </div>
      <div class="row">
          <div class="control-group span12">
              <label class="control-label">申请人银行名称：</label>
              <div style="display:inline;height:40px;margin-left: 10px;">
                  ${user.bankName}
              </div>
          </div>
      </div>
      <div class="row">
          <div class="control-group span12">
              <label class="control-label">银行卡号：</label>
              <div style="display:inline;height:40px;margin-left: 10px;">
                  ${user.cardName}
              </div>
          </div>
      </div>
      <div class="row">
          <div class="control-group span12">
              <label class="control-label">持卡人：</label>
              <div style="display:inline;height:40px;margin-left: 10px;">
                  ${user.cardName}
              </div>
          </div>
      </div>
      <div class="row">
          <div class="control-group span12">
              <label class="control-label">申请人所在地市：</label>
              <div style="display:inline;height:40px;margin-left: 10px;">
                  ${address.provinceName}${address.cityName}${address.areaName}
              </div>
          </div>
      </div>



      <c:if test="${data.status eq '0'}">
      <h3>处理意见</h3>
        <div class="row">
          <div class="control-group span12">
            <label class="control-label">是否通过：</label>
            <div style="display:inline;height:40px;margin-left: 10px;">
              <select name="status" id="status">
                  <option value="1">审核通过</option>
                  <option value="2">审核拒绝</option>
              </select>
            </div>
          </div>
        </div>

    </c:if>


    <div class="row form-actions actions-bar">
      <div class="span13 offset3 ">
          <c:if test="${data.status eq '0'}">
            <button type="submit" class="button button-primary">确定</button>
          </c:if>
       <button type="button" class="button" onclick="back()">返回</button>
      </div>
    </div>
  </form>
</div>
<script type="text/javascript" src="/resources/js/jquery-1.8.1.min.js"></script>
<script type="text/javascript" src="/resources/js/sea.js"></script>
<script type="text/javascript" src="/resources/js/bui-min.js"></script>
<script type="text/javascript" src="/resources/js/config-min.js"></script>


<script type="text/javascript">
  BUI.use('common/page'); //页面链接跳转
  BUI.use(['bui/tree','bui/form','bui/select','bui/data'],function (Tree,Form,Select,Data) {

    var form = new Form.HForm({
      srcNode : '#J_Form',
      submitType:"ajax",
      listeners:{
        beforesubmit:function(){

          return true;
        }
      },
      callback:function(data){
        BUI.Message.Alert(data.msg,function(){
          if(data.success){
            back();
          }
        },'info');
      }
    });

    form.render();
  });

  function back(){
    top.topManager.openPage({
      id : 'partner_apply',
      isClose : true
    });
    top.topManager.reloadPage('partner_apply');
  }

  $(function(){
      loadProvince();
  })

  function loadProvince(){
      $.ajax({
          url:"/front/loadCitys?r="+Math.random(),
          type:"post",
          data:{
              pid:"0"
          },
          success:function(res){
              if(res.success){
                  fillSelect("userProvince",res.data,$("#hide_province").val());
                  loadCity();
              }
          },
          error:function(){

          }
      })
  }
  function loadCity(){
      $.ajax({
          url:"/front/loadCitys?r="+Math.random(),
          type:"post",
          data:{
              pid:$("#userProvince").val()
          },
          success:function(res){
              if(res.success){
                  fillSelect("userCity",res.data,$("#hide_city").val());
                  loadArea();
              }
          },
          error:function(){

          }
      });
  }
  function loadArea(){
      $.ajax({
          url:"/front/loadCitys?r="+Math.random(),
          type:"post",
          data:{
              pid:$("#userCity").val()
          },
          success:function(res){
              if(res.success){
                  fillSelect("userArea",res.data,$("#hide_area").val());
              }
          },
          error:function(){

          }
      });
  }
  function fillSelect(id,data,no){
      var html = "";
      $.each(data,function(i,n){
          var ckd = "";
          if(n.no == no){
              ckd = "selected";
          }
          html += "<option value='"+n.no+"' "+ckd+">"+n.name+"</option>";
      });
      $("#"+id).html(html);
  }

</script>

</body>
</html> 